//
//  Test29.cpp
//  CPPTest
//
//  Created by you5 Yi on 2021/9/25.
//

#include "Test29.hpp"
#include <iostream>
#include <string.h>
using namespace std;
class A {
public:
    virtual void GetA() = 0;
};
class B: public A {
private:
    char str[32];
public:
    void GetA() {
        cout<<"Class A"<<endl;
    }
    const char *GetB() {
        return str;
    }
    B(char *s) {
        strcpy(str, s);
    }
};

void test29() {
    
    A *a;
    B b("Class B");
    a = &b;
    a->GetA();
    cout<<b.GetB()<<endl;
}
